using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Menu : System.Web.UI.UserControl
{
    categoryBus catBus = new categoryBus();
    public string categories;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            getMenu();
        }
    }
    public void getMenu()
    {
        categories = catBus.getCategories(0, loadLang());
    }
    public int loadLang()
    {
        try
        {
            HttpCookie cookie = Request.Cookies["language"];
            return Convert.ToInt32(cookie["language"].ToString());
        }
        catch (Exception)
        {
            return 1;
        }
    }
}
